import HTMLTestRunner_cn,logging,yagmail,time


aa = time.strftime('%Y%m%d%H%M%S',time.localtime())
class Tools():
    def Log(self):
        log = logging.basicConfig(level=logging.DEBUG,
                            filename='a3mall_baogao.log',
                            filemode='a+',
                            format='%(levelname)s %(filename)s %(message)s %(lineno)d')
        return log
    def BaogGao(self):
        baogao = HTMLTestRunner_cn.HTMLTestRunner(open('baogao.html','wb'),title='a3malll主题')
        return baogao


    def Email(self):
        aa = yagmail.SMTP(user='3153075207@qq.com',password='qhgbeikriqgjdcei',host='smtp.qq.com')
        aa.send(to='3153075207@qq.com',subject='youjian',contents='zhutu',attachments=['baogao.html','a3mall_baogao.log'])
        aa.close()

